package it.koutifaris.travianmap.tile.bounds;

import it.koutifaris.travianmap.tile.TileBounds;
import it.koutifaris.travianmap.tile.bounds.TileBoundsBuilder.StepBuild;
import it.koutifaris.travianmap.tile.bounds.TileBoundsBuilder.StepSize;

public class TileBoundsBuilderImpl implements TileBoundsBuilder, StepSize, StepBuild {

	private int x, y;
	private int width, height;

	@Override
	public StepSize setOrigin(int x, int y) {
		this.x = x;
		this.y = y;

		return this;
	}

	@Override
	public StepBuild withDefaultSize() {
		this.width = TileBounds.DEFAULT_TILE_SIZE;
		this.height = TileBounds.DEFAULT_TILE_SIZE;

		return this;
	}

	@Override
	public StepBuild withSize(int width, int height) {
		this.width = width;
		this.height = height;

		return this;
	}

	@Override
	public DefaultTileBounds build() {
		return new DefaultTileBounds(x, y, width, height);
	}

}
